<template>
  <div class="application-item-box">
    <div class="item-box-contant typeCloud" v-if="itemType == 'cloud'" @click="gotoDetails()">
      <div class="box-left">
        <van-image width="46" height="46" radius="10" :src="windowURL" />
      </div>

      <div class="box-center">
        <div class="box-center-top">王者荣耀</div>
        <div
          class="box-center-bottom"
          :style="{
            color: textColor,
          }"
        >
          空岛集结
        </div>
      </div>
      <div class="box-right"></div>
    </div>
  </div>
</template>

<script setup>
import { RouterView, useRoute, useRouter } from 'vue-router'
const router = useRouter()
const props = defineProps({
  itemType: {
    type: String,
    default: 'advertising', //advertising  cloud
  },
  buttonColo: {
    type: String,
    default: '', //按钮颜色
  },
  // itemData: {
  //   type: Object,
  //   default: {}, //advertising  cloud
  // },
  windowURL: {
    type: String,
    default:
      'https://img.zcool.cn/community/0102c65f8d2d2f11013e45843d8bce.jpg@1280w_1l_2o_100sh.jpg', //advertising  cloud
  },
  textColor: {
    type: String,
    default: 'fff', //文本颜色高度
  },
})
const gotoDetails = (id) => {
  console.log('gotoDetails')
  router.push({
    name: 'ApplicationDetails',
    query: {
      id,
    },
  })
}
</script>

<style lang="scss" scoped>
.application-item-box {
  display: flex;
  align-items: center;
  .item-box-contant {
    display: flex;
    align-items: center;
    width: 100%;
  }
  .box-left {
    width: 80px;
    display: flex;
    justify-content: center;
  }

  .typeCloud {
    padding: 10px 0;
  }
  .typeCloud .box-left {
    display: flex;
    justify-content: center;
    justify-content: flex-start;
    width: auto;
    margin-right: 12px;
  }

  .typeCloud .box-right {
    width: auto;
  }
  .box-center {
    flex: 1;
    .box-center-top {
      font-weight: bold;
      margin-top: 4px;
      margin-bottom: 4px;
      font-size: 14px;
    }
    .box-center-bottom {
      font-size: 13px;
      margin: 4px 0;
    }
  }
  .box-right {
    width: 90px;
  }
  .down-btn {
    font-weight: bold;
    background: rgb(245, 245, 245);
    border-color: rgb(245, 245, 245);
    color: #0d7ffe !important;
    padding: 8px 10px !important;
    font-size: 12px;
  }
  .white-color {
    color: #fff;
  }
}
</style>
